import server from "@/utils/request";
// 家校互动
// 健康
//分页获取所有带药提醒
export function link(payload: { cp: number, ps: number }) {
    return server.get(`/school/remind/getRemindByPage?cp=${payload.cp}&ps=${payload.ps}`)
}

// 删除
export function deleteAllInform(id: any) {
    return server.delete('/school/remind/deleteRemind/' + id)
}

// 健康查询
export function getRemindById(id: any) {
    return server.get('/school/remind/getRemindById/' + id)
}
// 健康新增
export function addlink(payload: { title: any, sId: any, tId: any, time: any, detail: any }) {
    return server.post(`/school/remind/saveRemind?title=${payload.title}&sId=${payload.sId}&tId=${payload.tId}&time=${payload.time}&detail=${payload.detail}`)
}
//出勤


// 根据时间获取考勤学生
export function getAttendanceByTimeByPage(payload: { time: any, cp: number, ps: number }) {
    return server.get(`/school/attendance/getAttendanceByTimeByPage/${payload.time}?cp=${payload.cp}&ps=${payload.ps}`)
}
//
// 根据ID标记为迟到
export function markLate(payload: { id: any }) {
    return server.get(` /school/attendance/markLate/${payload.id}`)
}
//
// 根据ID标记为缺勤
export function markedAbsent(payload: { id: any }) {
    return server.get(` /school/attendance/markedAbsent/${payload.id}`)
}

// 获取通知相关
export function jxInteractionList(payload: {cp: number,ps:number}){
    return server.get(`/school/inform/getInformByPage?cp=${payload.cp}&ps=${payload.ps}`)
}

// 获取通知类型
export function jxinformTypeList(payload: {cp: number,ps:number}) {
    return server.get(`/school/informType/getInformTypeByPage?cp=${payload.cp}&ps=${payload.ps}`)
}

// 通知列表新增
export function InteractionListAdd(payload: {title: string,typeId: number,range:number,tId: number,detail: string,priority: string}) {
    return server.post(`/school/inform/saveInform?title=${payload.title}&typeId=${payload.typeId}&range=${payload.range}&tId=${payload.tId}&detail=${payload.detail}&priority=${payload.priority}`)
}

// 通知列表删除
export function jxInformListDel(payload: number) {
    return server.delete(`/school/inform/deleteInform/${payload}`)
}

// 通知类型删除
export function jxInformTypeDel(payload: number) {
    return server.delete(`/school/informType/deleteInformType/${payload}`)
}

// 通知类型状态_停用
export function jxInformTypeStateStop(payload: number) {
    return server.post(`/school/informType/deactivate/${payload}`)
}

// 通知类型状态_启用
export function jxInformTypeStateOpen(payload: number) {
    return server.post(`/school/informType/enable/${payload}`)
}

// 通知类型新增
export function jxTypeAdd(payload: string) {
    return server.post(`/school/informType/saveInformType?name=${payload}&attribute=0&state=1`)
}

// 通知类型修改
export function jxTypeModify(payload: {id: number,name: string, attribute: string, state: string}) {
    return server.post(`/school/informType/updateInformType`,payload)
    // id=${payload.id}&name=${payload.name}&attribute=${payload.attribute}&state=${payload.state}
}

// 分页请假列表
export function jxGetLeaveRecordList(payload: {cp: number,ps:number}) {
    return server.get(`/school/leaveApplication/getLeaveApplicationByPage?cp=${payload.cp}&ps=${payload.ps}`)
}

// 请假驳回
export function jxDelLeave(payload: number) {
    return server.delete(`/school/leaveApplication/deleteLeaveApplication/${payload}`)
}

// 请假新增
export function jxAddLeave(payload: {sId: string, type: string, beginTime:string, endTime: string, detail: string, tId:string, state:string}) {
    return server.post(`/school/leaveApplication/saveLeaveApplication?sId=${payload.sId}&type=${payload.type}&beginTime=${payload.beginTime}&endTime=${payload.endTime}&detail=${payload.detail}&tId=${payload.tId}&state=${payload.state}`)
}

// 教师请假同意
export function leaveConsent(payload: number) {
 return server.post(`/school/leaveApplication/audit/${payload}`)
}
//审核列表获取相册数据
export function getPhotosByPage(payload={}){
    return server.get('/school/photos/getPhotosByPage',{params:payload})
}
// 发布消息驳回
export function deletePhotos(id:any){
    return server.delete('/school/photos/deletePhotos/'+id)
}
// 发布消息同意
export function agreePhotos(id:any){
    return server.get('/school/photos/agree/'+id)
}

// 评价列表
export function getEvaluateByPage(payload={}){
    return server.get('/school/evaluate/getEvaluateByPage',{params:payload})
}
// 删除列表
export function deleteEvaluate(id:any){
    return server.delete('/school/evaluate/deleteEvaluate/'+id)
}
// 测评类型
export function getEvaluateTypeAll(payload={}){
    return server.get('/school/evaluateType/getEvaluateTypeAll',{params:payload})
}